<template>
  <div>
    <h3>选择你喜欢的栏目</h3>
    <ul>
      <li v-for="item in list" :key="item">
        <input type="checkbox" @click="add" v-bind:value="item" v-model="selected"/>
        <span>{{ item }}</span>
      </li>
    </ul>
    <ul v-for="item,index in selected" :key="index">
      <li>
        <span>{{item}}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      selected:[]
    };
  },
methods:{
  add(){
  console.log(this.list)

  }

}
};
</script>

<style></style>
